package com.guanyong.admin.controllers.page;


import com.guanyong.model.UserInfoModel;
import com.guanyong.services.UserInfoService;
import com.guanyong.utils.NetUtils.CookieUtils;
import org.springframework.ui.Model;
import org.aspectj.weaver.patterns.TypePatternQuestions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import sun.util.calendar.BaseCalendar;



import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import java.util.*;

@Controller
@RequestMapping("/page/user")
public class UserPage  extends baseController{
    @Autowired
    UserInfoService userInfoService;

    @RequestMapping({"/userlist"})
    String userlist(HttpServletRequest request) {
        return "/user/userlist";
    }

    @RequestMapping({"/userinfo"})
    String userinfo(Model model, HttpServletRequest request) {
        String userid=request.getParameter("userid");
        UserInfoModel userInfoModel=userInfoService.GetUserInfoModelById(userid);
        if (userInfoModel!=null){
            model.addAttribute("user",userInfoModel);
            return "/user/userinfo";
        }
        else{
            return "errorPage/500";
        }

    }

    @RequestMapping({"/usermaster"})
    String usermaster(HttpServletRequest request) {
        return "/user/usermaster";
    }



}
